    
var globalVal = '';
function linkSoftOpr()
{
	 var size =document.getElementById("listsize").value;
	 var innerHTMLStr = "";
	 var link_down = "";
	 var k = 1;    
	 for(var i=0;i<size;i++)
	 {
		 if(document.getElementById('checkone'+i).checked)
		 {
			   var down_id = document.getElementById('checkone'+i).value;
			   link_down += down_id + "|";
			   var down_name = document.getElementById('chechGoodsName'+i).value;
			   setDivHtml(k,down_name,down_id);
			   innerHTMLStr += globalVal;
			   k++;
		 }             
	 } 
		  
	 document.getElementById("link_sw").value = link_down;
	 document.getElementById("g_soft_table").innerHTML= "<table width='100%' border='0' cellspacing='0' cellpadding='0' >" + innerHTMLStr + "</table>";
	 TB_remove();
}


function setDivHtml(k,down_name,down_id)
{
    globalVal = "<tr id='spandiv"+k+"'><td width='5%' height='35' align='right' style='background:#F9F9F9;'><font color='#666666'>"+k+":</font>"+"</td><td width='55%' style='background:#F9F9F9;'><font color='#666666'>"+down_name+"</font></td>"+"<td width='40%'>&nbsp;<img src='/program/company/index/images/cross.png' style='vertical-align:middle;cursor:pointer;' title=移除关联 onclick=moveout('"+k+"','"+down_id+"') /></td></tr>";
}

function moveout(k,down_id)
{
    var link_down = document.getElementById("link_sw").value;
    link_down = link_down.replace(down_id+'|','');
    document.getElementById("link_sw").value = link_down;    
    
    document.getElementById("spandiv"+k).style.display='none';
}    
    
    